package com.dankegongyu.demo.http.bean;

import java.io.Serializable;

/**
 * 获取 access token
 * for POST /oauth/access_token
 *
 * @author WuPuquan
 * @version 1.0
 * @since 2017/10/14 16:26
 */

public class OauthAccessTokenBody implements Serializable{
    private static final long serialVersionUID = -3307040788821956406L;

    public String client_id;
    public String client_secret;
    public String mobile;
    public String verify_code;
    public String scope;

    // 绑定手机号时需要加上微信登录信息
    public String unionid = "";
    public String openid = "";
    public String nickname = "";
    public String sex = "0"; // 1男2女（后端定的）
    public String headimgurl = "";
    public String province = "";
    public String city = "";

    /**
     * 获取 access token
     * @param mobile 手机号
     * @param verify_code 验证码
     */
    public OauthAccessTokenBody(String mobile, String verify_code) {
        this("4", "8LL3QRFpexYzlM1qI0SSEZzoBkbgqXuJKDxx1Zcx", mobile, verify_code, "");
    }

    /**
     * 获取 access token
     * @param client_id
     * @param client_secret
     * @param mobile 手机号
     * @param verify_code 验证码
     * @param scope 请求的接口权限
     */
    public OauthAccessTokenBody(String client_id, String client_secret, String mobile, String verify_code, String scope) {
        this.client_id = client_id;
        this.client_secret = client_secret;
        this.mobile = mobile;
        this.verify_code = verify_code;
        this.scope = scope;
    }

}
